<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.5imoban.net/download/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../common/bootstrap/bootstrap-4.4.0-dist/js/bootstrap.js"></script>
<link href="../css/chuqi.css" rel="stylesheet" type="text/css">
<title>信息管理系统</title>
<script type="text/javascript">
	
</script>
<style>
	.alt td{ background:black !important;}
	.btn_style{
		width: 98%;
		border: none;
	}
	.submit_btn{
		font-size: 16px;
	}
</style>
</head>
<body style="">
	<div class="neibu">
		<div class="row" id="title">
			【中期检查】需要教师对报告进行审核
		</div>
		<div class="row" style="width: 98%;">
			<table>
				<tr>
					<td style="width: 25%;">文件名</td>
					<td style="width: 25%;">学生</td>
					<td style="width: 25%;">学号</td>
					<td style="width: 15%;">评审状态</td>
					<td style="width: 10%;">文件操作</td>
				</tr>
				<tr>
					<td id="report_name" style="width: 25%;"></td>
					<td id="stu_name" style="width: 25%;"></td>
					<td id="stu_id" style="width: 25%;"></td>
					<td id="stu_status" style="width: 15%;"></td>
					<td style="width: 10%;"><button onclick="download()">下载</button></td>
				</tr>
			</table>
		</div>
		<div class="row" id="title">
			【中期检查】指导老师评审结果
		</div>
		<div class="row" style="width: 98%;" >
			<table>
				<tr>
					<td style="width: 40%;">评价项</td>
					<td style="width: 40%;">评价等级</td>
					<td style="width: 20%;">具体意见</td>
				</tr>
				<tr>
					<td style="width: 40%;">毕业设计中期进度完成情况</td>
					<td style="width: 40%;">
						<input type="text" value="" id="PorcessSituation" class="btn_style"  style="text-align:center;">
					</td>
					<td style="width: 20%;">
						<input type="text" value="" id="PorcessSituation_Comment" class="btn_style"  style="text-align:center;">
					</td>
				</tr>
				<tr>
					<td style="width: 40%;">中期任务完成度与后续实施计划</td>
					<td style="width: 40%;">
						<input type="text" value="" id="Plan" class="btn_style"  style="text-align:center;">
					</td>
					<td style="width: 20%;">
						<input type="text" value="" id="Plan_Comment" class="btn_style"  style="text-align:center;">
					</td>
				</tr>
				<tr>
					<td style="width: 40%;">报告写作水平</td>
					<td style="width: 40%;">
						<input type="text" value="" id="Level" class="btn_style"  style="text-align:center;">
					</td>
					<td style="width: 20%;">
						<input type="text" value="" id="Level_Comment" class="btn_style"  style="text-align:center;">
					</td>
				</tr>
			</table>
		</div>
		<div class="row" id="title">
			【中期检查】指导老师评审意见
		</div>
		<div class="row" style="text-align: left;">
			<textarea id="py" rows="5" style="width:99.6%;font-size:16px;"></textarea>
		</div>
		<button id="submit" onclick="submit()">提 交</button>
		<button onclick="back()">返 回</button>
	</div>
</body>
<script type="text/javascript">
	var action = sessionStorage.getItem("action");
	var stu_name = sessionStorage.getItem("stu_name");
	var stu_id = sessionStorage.getItem("stu_id");
	var stu_status = sessionStorage.getItem("stu_status");
	$(document).ready(function(){
		$("#stu_name").text(stu_name);
		$("#stu_id").text(stu_id);
		$("#stu_status").text(stu_status);
		$("#report_name").text("答辩中期报告");
		if(action == "view"){
			var data = {
					stu_id: stu_id,
					pj_status: "pj02"
			}
			$.ajax({
				url: "getpj",
				method: "post",
				data: data,
				dataType: "json",
				success: function(data){
					var pj = data[0];
					$("#PorcessSituation").val(pj.pj_bysjwcqk);
					$("#PorcessSituation_Comment").val(pj.pj_bysjwcqk);
					$("#Plan").val(pj.pj_wcqk);
					$("#Plan_Comment").val(pj.pj_wcqk_dj);
					$("#Level").val(pj.pj_bgxzsp);
					$("#Level_Comment").val(pj.pj_bgxzsp_dj);
					$("#py").text(pj.pj_bgxzsp_dj);
				},
				error: function(err){
					alert("获取评价信息出错！");
				}
				
			})
			$("#PorcessSituation").attr("readOnly",true);
			$("#PorcessSituation_Comment").attr("readOnly",true);
			$("#Plan").attr("readOnly",true);
			$("#Plan_Comment").attr("readOnly",true);
			$("#Level").attr("readOnly",true);
			$("#Level_Comment").attr("readOnly",true);
			$("#py").attr("readOnly",true);
			$("#submit").css("display", "none");
		}
	})
	function download(){ // 文件下载操作
		window.location.href = "downloadstu?stu_id=" + stu_id + "&type=pj02";
	}
	function submit(){
		var data = {
				stu_id: $("#stu_id").text(),
				pj_py: $("#py").val(),
				pj_bysjwcqk: $("#PorcessSituation_Comment").val(),
				pj_bysjwcqk_dj: $("#PorcessSituation").val(),
				pj_wcqk: $("#Plan_Comment").val(),
				pj_wcqk_dj: $("#Plan").val(),
				pj_bgxzsp:  $("#Level_Comment").val(),
				pj_bgxzsp_dj: $("#Level").val(),
				pj_status: "pj02"
		};
		$.ajax({
			type : 'post',
			url : '/Teacher/savepj',
			cache : false,
			async : false,
			data : data,
			dataType : 'json',
			success : function(data) {
				alert('提交成功!');
				window.history.back(-1);
			},
			error : function(err) {
				alert("提交失败!");
			}
		})
	}
	function back(){
		window.history.back(-1);
	}
</script>
</html>
